#ifndef __MESSAGEHANDLER_H__
#define __MESSAGEHANDLER_H__

#include <iostream>
#include <string>
#include <unordered_map>
#include <functional>
#include "musicServer.h"
#include "stdTcpService.h"

class MessageHandler
{
public:
    using HandlerFunctin = std::function<void(const std::string &)>;
    /* 构造函数 */
    MessageHandler(const std::shared_ptr<StdTcpSocket> & arg);
public:
    /* 处理注册的业务逻辑 */
    void handleMessage(const std::string & data);
    /* 处理登录的业务逻辑 */
    void handleLoginInfo(const std::string & data);

private:
    std::unordered_map<int, HandlerFunctin> m_handles;
    /* 音乐服务器 */
    MusicServer m_musicSever;
 
};


#endif